<div align="center">
<table border="0" cellspacing="0" cellpadding="0" class="tblbg" width="500">
	<tr>
	  <td>
	    <table border="0" cellspacing="1" width="100%">
  	      <tr>
	        <td class="tbltop">&nbsp;<?=$T['menu'][$url];?>&nbsp;</td>
	      </tr>
              <tr>
                <td width="100%">

                    <table border="0" width="100%" class="content">
                      <tr>
                        <td valign="top" width="10%" nowrap><b><?=$T['Username'];?>:</b>&nbsp;</td>
                        <td valign="top" width="100%" nowrap><b><?=$personaldata['username'];;?></td>
                      </tr>
                    <tr>
                        <td valign="top" width="10%" nowrap><b><?=$T['Full Name'];?>:</b>&nbsp;</td>
                        <td valign="top" width="100%" nowrap><b><?=$personaldata['name'];?></td>
                      </tr>
                    <tr>
                        <td valign="top" width="10%" nowrap><b><?=$T['Status'];?>:</b>&nbsp;</td>
                        <td valign="top" width="100%" nowrap><b><span class="service<?php if ($personaldata['suspend']=="true") echo "notok\">".$T['Suspended']; else echo "ok\">".$T['Active']; ?></span></td>
                      </tr>
<?php
					$ret = array();
					call_hook('web:personal:userinfo:table', $ret);
					foreach($ret as $item) {
?>
                    <tr>
                        <td valign="top" width="10%" nowrap><div align="left"><b><?=$item['name'];?>:</b>&nbsp;</td>
                        <td valign="top" width="10%" nowrap><div align="left"><b><?=$item['value'];?></td>
                      </tr>
<?php
					}
?>
                      <tr><td><br /></td></tr>
                    </table>

                    <table border="0" width="100%" class="content">
                      <tr>
                        <td colspan="2" align="left" bgcolor="#EBEBEB" nowrap><a href="<?=$current_url;?>&url=userset"><b><?=$T['User Access'];?></b></a></td>
                      </tr>
                      <tr>
                        <td nowrap class="features">
                          &nbsp;&nbsp;<?=$T['Access Level'];?></td>
                        <td nowrap class="features">
                          &nbsp;&nbsp;<?=$T['userlvl'][$personaldata['level']];?></td>
                      </tr>
                      <tr>
                        <td nowrap class="features">
                          &nbsp;&nbsp;<?=$T['User Type'];?></td>
                        <td nowrap class="features">
                          &nbsp;&nbsp;<?=$T['usertype'][$personaldata['type']];?></td>
                      </tr>
                      <tr>
                        <td nowrap class="features">
                          &nbsp;&nbsp;<?=$T['IP Restriction'];?></td>
                        <td nowrap class="features">
                          &nbsp;&nbsp;<?if(!$personaldata['ip_restrict']) echo $T['none']; else echo $personaldata['ip_restrict'];?></td>
                      </tr>
                      <tr>
                        <td nowrap class="features">
                          &nbsp;&nbsp;<?=$T['User Root Directory'];?></td>
                        <td nowrap class="features">
                          &nbsp;&nbsp;<?=str_replace($cfg['webdir']."/".$personaldata['id'],"",$personaldata['root']);?>/
                        </td>
                      </tr>
                      <tr><td><br /></td></tr>
                    </table>
                    <table border="0" width="100%" class="content">
                      <tr>
                        <td align="left" bgcolor="#EBEBEB" nowrap><a href="<?=$current_url;?>&url=userset"><b><?=$T['Hard Disk Usage'];?></b></a></td>
                        <td align="left" bgcolor="#EBEBEB" nowrap><b><?=$T['Used'];?>&nbsp;</b></td>
                        <td align="left" bgcolor="#EBEBEB" nowrap><b><?=$T['Total'];?></b></td>
                        <td align="left" bgcolor="#EBEBEB" nowrap colspan="2"><b><?=$T['Used'];?> %&nbsp;</b></td>
                      </tr>
                      <tr>
                        <td nowrap class="features">
                          &nbsp;&nbsp;E-mail &amp; Files
                        </td>
                        <td nowrap class="features">
                          &nbsp;&nbsp;<?=$personaldata['hd_used'];?> <?=$T['mb'];?></td>
                        <td nowrap class="features">
                          &nbsp;&nbsp;<?=(($personaldata['hd'] != -1) ? $personaldata['hd']." ".$T['mb'] : $T['Unlimited']);?></td>
                        <td nowrap class="features">
<?php
						if ($personaldata['hd'] != -1) {
                    		$tmp=(round($personaldata['hd_used'] / $personaldata['hd'] * 100,2));
?>
                    		<span class="service<?=(($tmp<100) ? 'ok' : 'notok');?>"><?=$tmp;?>&nbsp;</span>%
<?
						} else { echo $T['Unlim']; }
?>
						</td>
                        <td class="features"><div class="bargraphContainer"><div class='bargraph' style="width: <?=round($tmp);?>%;"></div></div></td>
                      </tr>
                      <tr><td><br /></td></tr>
                    </table>
                    <table border="0" width="100%" class="content">
                      <tr>
                        <td colspan="2" align="left" bgcolor="#EBEBEB" nowrap><a href="<?=$current_url;?>&url=emailset"><b><?=$T['menu']['emailset'];?></b></a></td>
                      </tr>
                      <tr>
<?
                                $aliases = str_replace(" ", ", ", $personaldata['aliases']);
                                if (!$aliases)
                                        $aliases = $T['none'];
?>
                        <td nowrap class="features">
                          &nbsp;&nbsp;<?=$T['E-Mail Aliases'];?></td>
                        <td nowrap class="features">
                          &nbsp;&nbsp;<?=$aliases;?></td>
                      </tr>
                      <tr>
                        <td nowrap class="features">
                          &nbsp;&nbsp;<?=$T['Catch-All'];?></td>
                        <td nowrap class="features">
                          &nbsp;&nbsp;<? if ($personaldata['catchall'] == "true") echo $T['on']; else echo $T['off']; ?></td>
                      </tr>
                      <tr>
                        <td nowrap class="features">
                          &nbsp;&nbsp;<?=$T['Forward'];?></td>
                        <td nowrap class="features">
                          &nbsp;&nbsp;<? if ($personaldata['forward']) echo $T['on']; else echo $T['off']; ?></td>
                      </tr>
                      <tr>
                        <td nowrap class="features">
                          &nbsp;&nbsp;<?=$T['Autoresponder'];?></td>
                        <td nowrap class="features">
                          &nbsp;&nbsp;<? if ($personaldata['autoreply']) echo $T['on']; else echo $T['off']; ?></td>
                      </tr>
                      <tr><td><br /></td></tr>
                    </table>
                    <table border="0" width="100%" class="content">
                      <tr>
                        <td colspan="2" align="left" bgcolor="#EBEBEB" nowrap><a href="<?=$current_url;?>&url=userset"><b><?=$T['User Preferences'];?></b></a></td>
                      </tr>
                      <tr>
                        <td nowrap class="features">
                          &nbsp;&nbsp;<?=$T['Language'];?></td>
                        <td nowrap class="features">
                          &nbsp;&nbsp;<?=$T[$personaldata['lang']];?></td>
                      </tr>
                      <tr>
                        <?
                                unset($skin_name);
                                if (file_exists("skin/list")) {
                                        $i = 0;
                                        $tmp = file("skin/list");
                                        while ($tmp[$i]) {
                                                $tmp_info = split("[[:space:]]+",$tmp[$i]);
                                                if ($tmp_info[0] == $personaldata['skin']) {
                                                        array_shift($tmp_info);
                                                        if (count($tmp_info) > 1)
                                                                $skin_name = implode(" ",$tmp_info);
                                                        else
                                                                $skin_name = $tmp_info[0];
                                                        break;
                                                }
                                                ++$i;
                                        }
                                }
                                if (!$skin_name)
                                        $skin_name = $cfg['defaultskin'];
                                ?>
                        <td nowrap class="features">
                          &nbsp;&nbsp;<?=$T['Interface Look'];?></td>
                        <td nowrap class="features">
                          &nbsp;&nbsp;<?=$skin_name;?></td>
                      </tr>
                                <? // check & parse user's default page
                                        if ($personaldata['favorites']) {
                                                $tmp = explode(":",$personaldata['favorites']);
                                                $fav_cp = $T['menu'][$tmp[0]];
                                                $fav_url = $T[$tmp[0]][$tmp[1]];
                                        }
                                        else {
                                                $fav_cp = $T['none'];
                                                $fav_url = $T['none'];
                                        }
                                ?>
                      <tr>
                        <td nowrap class="features">
                          &nbsp;&nbsp;<?=$T['Default Page'];?> <?=$T['Panel'];?></td>
                        <td nowrap class="features">
                          &nbsp;&nbsp;<?=$fav_cp;?></td>
                      </tr>
                      <tr>
                        <td nowrap class="features">
                          &nbsp;&nbsp;<?=$T['Default Page'];?> <?=$T['Page'];?></td>
                        <td nowrap class="features">
                          &nbsp;&nbsp;<?=$fav_url;?></td>
                      </tr>
					<tr><td><br /></td></tr>
                    </table>
                    <table border="0" width="100%" class="content">
                      <tr>
                        <td colspan="3" align="left" bgcolor="#EBEBEB" nowrap><b><?=$T['Latest Login Attempts'];?></b></td>
                      </tr>
                      <tr>
                        <td align="left" bgcolor="#EBEBEB" nowrap><font size="1"><b><?=$T['Time of Login'];?></b></font></td>
                        <td align="left" bgcolor="#EBEBEB" nowrap><font size="1"><b><?=$T['Login Status'];?></b></font></td>
                        <td align="left" bgcolor="#EBEBEB" nowrap><font size="1"><b><?=$T['Remote IP Address'];?></b></font></td>
                      </tr>
<?php
                        $SQL = "SELECT time, log_msg, extra, remote_ip FROM log WHERE log_msg like 'login %' AND extra = '".$personaldata['username']." (".$personaldata['id'].")' ORDER BY time desc LIMIT 0,5";
                        $res = mysql_query($SQL);
                        if (mysql_num_rows($res)) {
                                for($i=0; $row=mysql_fetch_array($res); $i++) {
?>
                      <tr>
                        <td nowrap class="features"><?=date("m-d-y g:i A", strtotime($row["time"]));?></td>
                        <td nowrap class="features"><?=$row["log_msg"];?></td>
                        <td nowrap class="features"><?=(($userdata['type'] != 'demo') ? $row["remote_ip"] : 'xx.xx.xx.xx');?></td>
                      </tr>
<?php
							}
                        } else {
?>
                      <tr>
                        <td nowrap class="features" colspan="3">&nbsp;&nbsp;<?=$T['No log entries'];?></td>
                      </tr>
<?php
 							}
?>
					</table>
                  </td>
                </tr>
              </table>
           </td>
        </tr>
	</table>
</div>
